package com.syf.core.service.enums;

/**
 * 系统级错误的返回内容
 */
public enum ResponseFormatEnums implements ResponseFormat {
    SUCCESS("000000", "SUCCESS"),
    SERVICE_EXECUTION_THREAD_INTERRUPT("900001", "service执行线程被终止，交易码：{}，链路号：{}"),
    SERVICE_EXECUTION_EXCEPTION("900002", "service执行线程池出现ExecutionException异常，交易码：{}，链路号：{}"),
    SERVICE_EXECUTION_TIMEOUT("900003", "service执行线程的执行时间超时，交易码：{}，链路号：{}"),

    SERVICE_NOT_FOUND("800001", "未找到对应service:{}"),
    SERVICE_PROCESS_HAS_EXCEPTION("800002", "执行service出现异常"),

    REQUEST_PARAM_IS_ILLEGAL("700001", "ServiceRequest输入参数校验非法，具体原因：{}"),
    RESPONSE_PARAM_IS_ILLEGAL("700002", "ServiceResponse输入参数校验非法，具体原因：{}"),

    REQUEST_PROCESS_TIMEOUT("700031", "服务端处理请求超时"),

    DEFAULT("999999", "系统异常");

    private final String respCode;

    private final String respMsgFmt;

    ResponseFormatEnums(String respCode, String respMsgFmt) {
        this.respCode = respCode;
        this.respMsgFmt = respMsgFmt;
    }

    @Override
    public String getRespCode() {
        return respCode;
    }

    @Override
    public String getRespMsgFmt() {
        return respMsgFmt;
    }
}
